Skip to content

Avoid false green framework CSP checks#33728

Open
EugeniyKiyashko wants to merge 3 commits into
DevExpress:26_1from
EugeniyKiyashko:26_1_revert
Open

Avoid false green framework CSP checks#33728
EugeniyKiyashko wants to merge 3 commits into
DevExpress:26_1from
EugeniyKiyashko:26_1_revert

Conversation

@EugeniyKiyashko
Copy link
Copy Markdown
Contributor

No description provided.

@EugeniyKiyashko EugeniyKiyashko force-pushed the 26_1_revert branch 4 times, most recently from ca9065f to 8e9fa18 Compare June 2, 2026 16:52
@EugeniyKiyashko EugeniyKiyashko changed the title Test CI Repair framework CSP checks Jun 2, 2026
@EugeniyKiyashko EugeniyKiyashko force-pushed the 26_1_revert branch 2 times, most recently from 26bbe83 to 5d4c06b Compare June 2, 2026 18:47
@EugeniyKiyashko EugeniyKiyashko changed the title Repair framework CSP checks Avoid false green framework CSP checks Jun 3, 2026
@EugeniyKiyashko EugeniyKiyashko marked this pull request as ready for review June 3, 2026 05:32
Copilot AI review requested due to automatic review settings June 3, 2026 05:32
@EugeniyKiyashko EugeniyKiyashko requested review from a team as code owners June 3, 2026 05:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the demos CSP validation pipeline to avoid “false green” results by checking production-style (bundled) pages for React/Vue/Angular, tightening per-framework CSP allowlists, and improving CSP-check robustness.

Changes:

  • Add demo pre-bundling for CSP checks (esbuild for React/Vue; Angular AOT bundling via @angular/build/private) and route CSP checks to apps/demos/csp-bundled-demos.
  • Refactor CSP server directives/allowlists to distinguish SystemJS dev needs vs bundled needs; add Angular ngCspNonce stamping for bundled demos.
  • Clean up multiple Angular demo sources to remove unnecessary $event bindings, fix template binding typos, and remove inline styles/external font dependency that can affect CSP.

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/devextreme-scss/scss/widgets/generic/treeView/_index.scss Removes an unused SCSS @use import to reduce redundant dependencies.
apps/demos/utils/server/tsconfig.csp-bundle-angular.json Adds a dedicated TS config used by the Angular CSP bundler.
apps/demos/utils/server/csp-server.js Splits CSP behavior between SystemJS dev vs bundled demos; switches to report-only header and adds Angular nonce stamping for styles.
apps/demos/utils/server/csp-check.js Reworks CSP checking to use a single CDP-driven Chrome instance and in-page violation capture; adds bundling mode + sharding support.
apps/demos/utils/server/csp-bundle.js New: bundles React/Vue demos into production-style pages for CSP validation.
apps/demos/utils/server/csp-bundle-angular.js New: bundles Angular demos (AOT) into production-style pages for CSP validation, with sharding and patch/shim helpers.
apps/demos/Demos/TreeView/ItemSelectionAndCustomization/Angular/app/app.component.ts Removes BrowserModule from standalone imports for CSP-friendly bundling.
apps/demos/Demos/TreeList/MultipleRowSelection/Angular/app/app.component.html Drops unused $event parameter from option change handlers.
apps/demos/Demos/TreeList/CustomizeKeyboardNavigation/Angular/app/app.component.html Fixes a casing typo in editOnKeyPress binding.
apps/demos/Demos/Stepper/FormIntegration/Angular/app/app.component.html Drops unused $event parameter from button click handlers.
apps/demos/Demos/SpeechToText/Overview/Angular/app/app.component.html Drops unused $event parameter from button click handler.
apps/demos/Demos/Scheduler/DragAndDrop/Angular/app/app.component.html Fixes @for ... track expression to use an existing stable field.
apps/demos/Demos/Localization/UsingIntl/Angular/app/app.component.html Fixes applyFilter binding to use a string literal instead of an undefined identifier.
apps/demos/Demos/Localization/UsingGlobalize/Angular/app/app.component.html Fixes applyFilter binding to use a string literal instead of an undefined identifier.
apps/demos/Demos/LoadIndicator/Overview/Angular/app/app.component.html Drops unused $event parameter and collapses markup to avoid unnecessary inline patterns.
apps/demos/Demos/List/Selection/Angular/app/app.component.ts Removes BrowserModule from standalone imports for CSP-friendly bundling.
apps/demos/Demos/Form/ItemCustomization/Angular/app/app.component.ts Tightens template-related typing (array element shape) for consistency under AOT/bundling.
apps/demos/Demos/Form/Grouping/Angular/app/app.component.ts Tightens template-related typing (array element shape) for consistency under AOT/bundling.
apps/demos/Demos/FilterBuilder/Customization/Angular/app/app.component.ts Removes BrowserModule from standalone imports for CSP-friendly bundling.
apps/demos/Demos/FileUploader/ChunkUpload/Angular/app/app.component.html Drops unused $event parameter from upload started handler.
apps/demos/Demos/Drawer/TopOrBottomPosition/Angular/index.html Removes external Font Awesome stylesheet to reduce CSP exceptions.
apps/demos/Demos/Drawer/LeftOrRightPosition/Angular/index.html Removes external Font Awesome stylesheet to reduce CSP exceptions.
apps/demos/Demos/Drawer/LeftOrRightPosition/Angular/app/app.component.html Replaces inline style with a CSS class to avoid inline-style CSP violations.
apps/demos/Demos/Drawer/LeftOrRightPosition/Angular/app/app.component.css Adds styling for the new drawer panel class (keeps styles out of inline attributes).
apps/demos/Demos/DataGrid/NewRecordPosition/Angular/app/app.component.ts Removes BrowserModule from standalone imports for CSP-friendly bundling.
apps/demos/Demos/DataGrid/CustomizeKeyboardNavigation/Angular/app/app.component.html Fixes a casing typo in editOnKeyPress binding.
apps/demos/Demos/Chat/MessageEditing/Angular/app/app.component.html Fixes a binding typo (allowEditingLabel).
apps/demos/Demos/Charts/TilingAlgorithms/Angular/app/app.component.ts Removes BrowserModule from standalone imports for CSP-friendly bundling.
apps/demos/Demos/Charts/CenterLabelCustomization/Angular/app/app.component.html Replaces inline SVG styling with CSS classes to avoid inline-style CSP violations.
apps/demos/Demos/Charts/CenterLabelCustomization/Angular/app/app.component.css Adds CSS for the new SVG label classes.
apps/demos/Demos/Charts/AreaSelectionZooming/Angular/app/app.component.html Drops unused $event parameter and collapses markup for CSP-friendly bundling.
apps/demos/Demos/ActionSheet/PopoverMode/Angular/app/app.component.html Fixes @for ... track expression to use an existing stable field.
apps/demos/.gitignore Ignores csp-bundled-demos output and Angular bundler scratch artifacts.
.github/workflows/visual-tests-demos.yml Enables bundling + sharding for CSP checks in CI and adjusts artifact naming accordingly.

Comment thread apps/demos/utils/server/csp-check.js
dmlvr
dmlvr previously approved these changes Jun 3, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: EugeniyKiyashko <EugeniyKiyashko@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 3, 2026 08:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.

Comment thread apps/demos/utils/server/csp-check.js Outdated
Comment on lines +408 to +412
await startBrowser();

const reportFile = join(REPORT_DIR, `csp-violations-${FRAMEWORK.toLowerCase()}.jsonl`);
try {
await runPool(demos, CONCURRENCY, async (demo, i) => {
const idx = i + 1;
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: EugeniyKiyashko <EugeniyKiyashko@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.


const CHROME_PATH = findChrome();

const DEBUG_PORT = 20222;
Comment on lines +79 to +82
const CHROME_USER_DATA_DIR = process.env.CSP_CHROME_USER_DATA_DIR
|| join(os.tmpdir(), 'csp-chrome-shared');
const CHROME_DISK_CACHE_DIR = process.env.CSP_CHROME_DISK_CACHE_DIR
|| join(os.tmpdir(), 'csp-chrome-cache');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants